import {request2, get, post, postUpload, downfile} from './request'

export function getEnv(config){
    return request2({
        url:"/getenv/",
        params: config
    })
};


export function queryEnv(config){
    return request2({
        url:'/queryenv/',
        params:config
    })
}


// export function addEnv(obj){
//     return sendPost({
//         url:'/addenv/',
//         method:'post',
//         JSON:obj
//     })
// }

//获取环境下拉框架
export const getCenv = p =>get('/getcenv/', p);


//新增环境
export const addEnv = p => post('/addenv/', p);

//条件查询环境
export const searchEnv = p => post('/queryenv/', p);

//id获取一条环境记录
export const getenvInfo = p => post('/getenvinfo/', p);

//修改环境数据
export const updateEnv = p => post("/updataenv/", p);

//删除一条数据
export const delEnv = p => post('/deleteenv/', p);

//获取接口分类树
export const getApicat = p =>get('/getapicat/', p);

//添加接口节点
export const addApinode = p =>post('/addapinode/', p);

//删除接口节点
export const delApinode = p =>post('/delapinode/', p);

//请求接口数据
export const getApidata = p =>post('/getapidata/', p);

//添加接口数据
export const addApi = p =>post('/addapidata/', p);

//修改接口
export const updataApi = p =>post('/updateapi/', p);

//删除接口
export const delApi = p =>post('/delapidata/', p);

//条件查询接口
export const queryApi = p =>post('/queryapidata/', p);

//获取接口类型
export const getApitype = p =>get('/getapimethod/', p);

//通过id查询接口
export const getApiInfo = p =>post('/getapibyid/', p);

//设置接口mock状态
export const setApimock = p =>post('/setapimock/', p);

//获取用例数据
export const getCase = p =>post('/getcasedata/', p);

//获取公共方法
export const getCommonmethod = p =>get('/getcommonmethod/', p);

//新增用例
export const addCase = p =>post('/addcase/', p);

//获取用例详情
export const getCaseInfo = p =>get('/casedetail/', p);

//修改用例信息
export const updateCaseData = p =>post('/updatacase/', p);

//添加测试计划
export const addPlan = p =>post('/addplan/', p);

//获取测试计划
export const getPlan = p =>get('/getplan/', p);

//获取计划详情
export const getPlanDetail = p =>get('/getplandetail/', p);

//更新计划
export const updataPlan = p =>post('/updataplan/', p);

//触发用例执行
export const caseExcute =p =>post('/casexcute/', p);

//触发计划执行
export const planExcute = p =>post('/planexcute/', p);

//获取单个用例测试报告集
export const getCaseReports = p =>get('/getcasereps/', p);

//获取报告详情
export const getReportDetail = p =>get('/getreportDetal/', p);

//获取计划执行记录
export const getPlanExRecord = p =>get('/getplanrecord/', p);

//获取计划执行的用例记录
export const getPlanRecordRep = p =>get('/getrecortcaserep/', p);

//导入用例
export const importCase = p =>postUpload('/importcase/', p);

//获取导入用例记录
export const getImportRecord = p =>get('/getimprecord/', p);

//获取导入记录文件
export const getImportFiles = p =>downfile('/getimportfile/', p);

//下载用例模板
export const getCaseModel = p =>downfile('/getcasemodel/', p);

//获取执行记录
export const getExeRecord = p =>get('/getexerecord/', p);

//获取用例报告列表
export const getRepcaselist = p =>get('/getplancasereport/', p);

// 获取测试报告信息
export const getRecordinfo = p =>get('/getrecordinfo/', p);

// 更新树节点
export const updataCat = p =>post('/updatacat/', p);

// 下载帮助文档
export const getHelpFile = p =>downfile('/gethelpfile/', p);

//获取自定方法的规则描述
export const getComdes = p =>get('/getcomdes/', p);

//更新测试计划的定时计划状态
export const updataShced = p =>post('/updatasched/', p);

//通过env_id获取db配置
export const getDbcnf = p =>get('/getdbcnf/', p);





